<template>
  <div>
    <div class="foodTips">
      <span class="icon">{{flag}}F</span>
      <span>{{floorTitle}}</span>
    </div>
    <div class="floor">
      <div class="floor-anomaly">
        <div class="floor-one">
          <img :src="floorData0.image" width="100%" />
        </div>
        <div>
          <div class="floor-two"><img :src="floorData1.image" width="100%" /></div>
          <div class="floor3"><img :src="floorData2.image" width="100%" /></div>
        </div>
      </div>
      <div class="floor-rule">
        <div v-for="(item,index) in floorData.slice(3)" :key="index">
          <img :src="item.image" width="100%" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
    props:['floorData','floorTitle','flag'],
    data() {
        return {
            floorData0:{},
            floorData1:{},
            floorData2:{},
        }
    },
    watch:{
        floorData:function(val){
            this.floorData0 = this.floorData[0];
            this.floorData1 = this.floorData[1];
            this.floorData2 = this.floorData[2];
        }
    }
}
</script>

<style scoped>
.foodTips {
  background: #eee;
  padding: 0.5rem;
  text-align: center;
}
.foodTips span {
  color: #e45e4e;
}
.foodTips .icon {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  background: #e45e4e;
  border-radius: 50%;
  color: #fff;
  text-align: center;
  line-height: 1.5rem;
}
.floor-anomaly{
  display: flex;
  flex-direction: row;
  background-color: #fff;
  border-bottom: 1px solid #ddd;
}
.floor-anomaly div{
  width: 10rem;
  box-sizing: border-box;
}
.floor-one{
  border-right: 1px solid #ddd;
}
.floor-two{
  border-bottom: 1px solid #ddd;
}
.floor-rule{
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  background-color: #fff;
}
.floor-rule div{
  box-sizing: border-box;
  width: 10rem;
  border-bottom: 1px solid #ddd;
}
.floor-rule div:nth-child(odd){
  border-right: 1px solid #ddd;
}
</style>